﻿// //  ********************************************************************************
// //  Copyright (C) 2016 Sebastian Kenter. All rights reserved.
// // 
// //  Name    : PhotonServerProject | PhotonServerFramework | PeerConfiguration.cs
// //  Created : 2016 - 03 - 21 11:49
// //  Modified: 2016 - 04 - 18 09:37
// //  ********************************************************************************

using System.Collections.Generic;
using System.Linq;
using PhotonServerFramework.Interfaces.Configuration;

namespace PhotonServerFramework.Implementation.Configuration
{
    public class PeerConfiguration : IPeerConfiguration
    {
        private readonly IList<object> _configuration = new List<object>();

        public void AddConfiguration(object configurationObject)
        {
            _configuration.Add(configurationObject);
        }

        public T GetConfiguration<T>() where T : class
        {
            return _configuration.FirstOrDefault(c => c is T) as T;
        }
    }
}
